Access control to data processing means

ABSTRACT

The invention concerns a method aimed at preventing secret codes manipulations is a data processing means, such as a smart card (CA), by applying thereto a presented code. The method for accessing a functionality of the card comprises prior to implementation (E 1 ) of a code transforming function (FT) in the processing means (CP), transformation (E 2 ) of the secret code (CS) into a transformed secret code (CST) in the card. For each use of the card are provided transformation function, and a comparison (E 7 ) of the transformed secret code with the transformed secret code in the card.

[0001] The present invention relates in general terms to any electronic data processing means of which the functionalities, or services which are related thereto, are accessible by a confidential code, also referred to as a password or secret code, which is most often received by the processing means following keying-in on the keyboard of an accepting means of the processing means.

[0002] For example, the data processing means is a microcontroller card, also referred to as an integrated circuit card or smart card, such as a credit card for a bank terminal or an electronic purse card for a point-of-sale terminal, or for any other terminal such as a mobile radiotelephone terminal equipped with an add-on card reader, or else such as a SIM (Subscriber Identity Module) identity card in a mobile radiotelephone terminal.

[0003] More particularly, the invention relates to the security of controlling access to the functionalities of the smart card by, a confidential code received thereby so as to compare it with a secret confidential code associated with the smart card and currently pre-stored therein.

[0004] An attacker, an ill-intentioned person, wishing to know the secret confidential code of a smart card, can carry out a Single Power Analysis (SPA) by connecting a voltage-measuring apparatus to the electrical interface between the smart card and its accepting terminal.

[0005] In a smart card according to the prior art, the secret confidential code pre-stored in a non-volatile memory of the smart card is manipulated during verification of any confidential code presented with a view to authenticating the true holder of the smart card. In particular, the processor in the card reads the secret code from the non-volatile memory and compares it with the received code written temporarily into the RAM memory of the smart card.

[0006] Current smart cards thus present possibilities of leakages of information resulting from the recording of energy consumption characteristics of the smart card.

[0007] The present invention aims to increase the security of checking of the confidential code received by a data processing means, such as a smart card, and to avoid any manipulation of the secret code in the data processing means.

[0008] To that end, a method for accessing a data processing means associated with a secret confidential code and accessible by applying thereto a confidential code presented by an accepting means is characterised in that it comprises the following steps:

[0009] first, implementation of a code transformation function in the processing means, and then transformation of the secret code into a transformed secret code according to the transformation function and storing of the transformed secret code in the processing means; and

[0010] at each use of the processing means, transformation of the presented code into a transformed presented code according to the transformation function implemented in the processing means, and comparison of the transformed secret code with the transformed presented code in the processing means.

[0011] Thus, during the use of the processing means, such as a smart card, the secret code is not stored therein and is therefore not manipulated in the card during any presentation of the presented confidential code.

[0012] As will be seen in detail subsequently, the transformation function can be irreversible, a hashing, linked to a random number fixed at the time of creation of the card or else dependent upon a second random number variable at each presentation of the presented code, applied iteratively according to the number of previous presentations of the presented code, a predetermined code part permutation, or a homomorphic function. Certain of these transformation function characteristics can be combined with one another.

[0013] Other characteristics and advantages of the present invention will emerge more clearly from a reading of the following description of a number of preferred embodiments of the invention with reference to the corresponding accompanying drawings in which

[0014]FIG. 1 is a schematic block diagram showing a system for implementing the access control method according to the invention within the context of a smart card; and

[0015]FIG. 2 is an algorithm of the main steps of the access control method according to a number of embodiments of the invention.

[0016] According to the embodiment illustrated in FIG. 1, an electronic data processing means is constituted by a smart card (chip card) CA, the “chip” of which consists of a microcontroller. Schematically, the microcontroller comprises a central processing unit CPU formed by a microprocessor PR, a ROM type memory MO, including an operating system OS of the card and in particular specific communication and authentication application algorithms, a programmable and erasable type non-volatile memory MNV, such as an EEPROM memory, which contains data in particular connected with the card holder and the card supplier, and a RAM type memory MA intended to receive in particular data from an accepting terminal TE for the card. All the components PR, MO, MNV and MA are interconnected by an internal bus BU.

[0017] The accepting terminal TE, such as a bank terminal or a telephone terminal, is equipped with a keyboard CL in order, in particular to key in a confidential code CP, also referred to as a submitted code, to be presented to the card. Into a reader LE of the terminal TE there is inserted part of the card CA containing the microcontroller and typically bearing eight electrical contacts of an electrical link LI between the reader LE and the bus BU internal to the card CA when the card is of the type with contacts.

[0018] With reference now to FIG. 2, the access control method according to a preferred embodiment of the invention for the smart card CA shown in FIG. 1 comprises essentially seven steps E1 to E7.

[0019] The first steps E1 to E3 are first carried out, at the premises of the card supplier, at the time of manufacture of the card and then at the time of acquisition of the card CA, for example at the time of subscription to a service accessible by the functionalities of the card.

[0020] At the time of manufacture of the card, a predetermined confidential code transformation function FT for subsequently: transforming the presented confidential code CP in the card into a transformed presented code CPT, as will be seen later, is implemented in the memory MO of the card. The card CA is delivered with the implemented transformation function FT by the card manufacturer to the card supplier. According to data of the card manufacturer in particular, the card supplier assigns a preferably encrypted secret confidential code CS, for example having four digits, to the card CA, which is decrypted at the step E1.

[0021] Immediately, the processor PR of the card transforms the secret confidential code CS into a transformed secret code CST=FT(CS) according to the predetermined transformation function FT, a number of examples of which will be described in detail in the remainder of the description. At the step E3, the transformed secret code CST is written into the non-volatile memory MNV of the card CA. The secret code CS is thus not kept in clear in the card.

[0022] Thus, the transformation of the secret confidential code, which was constantly contained in non-volatile memory in the smart cards of the prior art, into the transformed secret code CST is carried out before any presentation of the presented code CP to the card, and the transformed secret code CST, and not the secret code, is kept in non-volatile memory MNV.

[0023] The steps E4 to E7 are performed after insertion of the card CA into the reader LE of the accepting terminal TE which is thus connected by the electrical link LI and the internal bus BU to the microcontroller of the card CA.

[0024] Each time the card is used, a presented code CP, which must normally be identical to the secret code, is keyed in on the keyboard CL of the terminal TE at the step E4 in order to verify the presented code in the card CA. Either as the digits of the presented code, for example four in number, are keyed in, or as a whole, the terminal TE transmits the presented code CP to the card CA through the link LI and the bus BU in order that it is written into the RAM memory MA, at the step E5.

[0025] At the following step E6, the processor PR transforms the presented code CP recorded in the memory MA into a transformed presented code CPT according to the transformation function FT implemented in the card CA.

[0026] Finally, the processor PR reads the transformed secret code CST from the memory MNV and compares it with the transformed presented code CPT which has just been determined, at the step E7. If the compared codes CST and CPT are identical, the functionalities of the card CA are accessible, for example for accessing a service, such as a payment service or a telephone service. Otherwise, when the compared codes CST and CPT are different, a limited number of other attempts to key in another presented code can be made.

[0027] According to a first embodiment, the code transformation function FT is a hashing H. For example, the four-bit word of each of the four digits, or more generally of the octet of one of the characters, of the confidential code CS, CP is transformed by hashing into a number of octets, typically a few tens of octets, and the transformed code CST, CPT comprises four sets of a few tens of octets.

[0028] Moreover, the hash function H does not have a reciprocal function, that is to say it is irreversible. Such a function is also referred to as a “one-way function” which is a function which is relatively easy to calculate but considerably more difficult to reverse. In other words, there is no function H⁻¹, or it is very difficult to find a function H⁻¹ such that:

CF=H ⁻¹ [H(CF)],

[0029] where CF represents any confidential code whatsoever.

[0030] The one-way nature of the hash function thus prevents decryption of the transformed code CST=H(CS) stored in the card CA in order to find the original secret code CS.

[0031] Hashing makes it possible to avoid in particular a search for a confidential code character by character, that is to say octet by octet. The knowledge of one hashed character does not enable the other characters of the secret code to be deduced.

[0032] According to a second embodiment, the code transformation function FT is applied to the confidential code CS, CP and a random number NA. The transformation function is for example a logic function, such as the Exclusive-OR function (XOR).

[0033] The transformed code CST, CPT results from application of the respective confidential code CS, CP and a random number NA to the transformation function FT. The random number NA is produced by a random generator associated with the processor PR, once and for all at the creation of the card CA, at the time of assigning and writing of the secret code CS at the step E1. The processor PR transforms the secret code CS into a transformed secret code CST=FT(CS, NA) at the step E2 in order to store it with the random number NA in the memory MNV.

[0034] For example, the transformation function FT can be a combination of the confidential code CS, CP and the random number NA. The random number NA can be a diversification element of the secret code CS.

[0035] At the step E6, the processor PR reads not only the presented code CP from the memory MA but also the random number NA from the memory MNV so as to produce the transformed presented code CPT=FT(CP; NA). According

[0036] According to this second embodiment, two smart cards associated with identical secret confidential codes are associated with different random numbers. The random numbers being a priori different for the two cards, the effects of manipulating these random numbers cannot be used for characterisation of the cards. This is because the Single Power Analysis of the smart card is not representative of the secret code in clear, but is representative of the secret code transformed according to a transformation known to the attacker. The information on the secret code CS cannot be deduced from the transformed secret code CST because the diversification element NA is not known by the attacker.

[0037] Preferably, there is a respective random number NA corresponding to each secret code CS. Thus advantageously, when the secret code associated with a card is modified, the random number NA is also modified. For example if two digits of a secret code are reversed, the two random numbers corresponding to these two secret code versions are different. This variant makes it possible to avoid a random number in a first card being recognised by means of manipulation of the random number in another card associated with a confidential code common with the first card.

[0038] According to a third embodiment, the number NA is generated initially and a second random number NA′ is produced by the random generator associated with the processor PR in the card CA, before the transformation of the presented code CP, at each verification of the presented code CP. The steps E6 and E7 are then replaced by steps E6 a and E7 a also shown in FIG. 2. On the one hand, the transformation function is applied to the previously stored transformed secret code CST and to the second random number NA′ in order to determine a second transformed secret code CST′=FT(CST, NA′). On the other hand, the transformation function is applied a first time to the received presented code CP and to the previously produced first random number. NA in order to produce an intermediate transformed presented code CPT′=FT(CP, NA), and then applied a second time to the intermediate transformed presented code CPT and to the second random number NA′ in order to produce the transformed presented code CPT′=FT(FT(CP, NA), NA′)=FT(CPT, NA′). Then the codes CST′ and CPT′ are compared at the step E7 a.

[0039] The third embodiment of the method according to the invention guarantees that, within the smart card, there is never the same value of transformed confidential code CST′; and therefore that the verification of the presented confidential code CP is never carried out in the same way in the smart card CA.

[0040] For example, the transformation function FT is a simple arithmetic operator such as addition, that is:

CST′=CST+NA′

[0041] with

CST=CS+NA

[0042] and NA in memory MNV, and

CPT=(CP+NA)+NA′.

[0043] A fourth embodiment close to the last variant described above consists, after the first verification of the presented code CP resulting from the comparison of the transformed secret code CST=FT(CS) and the transformed presented code CPT=FT(CP), of storing the transformed secret code CST and, for each presentation of the presented code, applying the code transformation function FT to the previously stored transformed secret code. Thus, for a second presentation, the processor PR compares the transformed codes CST₂=FT(CST), which is stored, and CPT₂=FT(CPT), then for a third presentation following a second positive verification, compares the transformed codes CST₃=FT(CST₂), which is stored, and CPT₃=FT (CPT₂)=FT(FT(CPT))=FT(FT(FT(CP))), and so on at each presentation of the presented code, the transformed secret code CST_(i) is stored and compared with the transformed presented code CPT_(i)=FT^(i) (CP) resulting from the previous applications. After each verification, the value of the transformed secret code which is stored in the memory MNV is different from that which was stored at the previous verification.

[0044] In the fourth embodiment, as shown at steps E6 b and E7 b replacing the steps E6 and E7 in FIG. 2 from the second presentation, the processor PR, at the i^(th) presentation of the code CP in the card CA, applies the function FT i times to the presented code CP which can be relatively long; for example the function FT is a function modulo a prime number P.

[0045] In order to reduce the calculation time of the function FT^(i), the function FT can be the exponent function modulo the predetermined integer number P. Thus, at each presentation of the presented code, the previous applications of the transformation function to the presented code CP are replaced in the processor PR by an application of the transformation function to the last presented code CPT_(i−1) and to the presented code CP in order to produce the transformed presented code CPT_(i) =FT(CPT_(i−1), CP)=FT[(CPT)^(i−1), CP] modulo P, instead of applying the function FT i times to the presented code CP. Then, when at the end of the comparison (step E7 b) the compared transformed, codes CST_(i) and CPT_(i) are identical, the latter are stored in the memory MNV in place of the previous codes CST_(i−1) and CPT_(i−1).

[0046] According to another example, the code transformation function FT can be a simple arithmetic function, such as addition CPT_(i)=(CP+CPT_(i−1)) modulo P.

[0047] In a variant, instead of storing the transformed presented code CPT_(i), the applications of the transformation function to the presented code CP are replaced by an application of a transformation function equivalent to the i^(th) iteration FT^(i) of the transformation function in order to produce a transformed presented code CPT_(i). This variant thus concerns a function FT^(i) directly dependent on the index i and on the presented code. For example, the function FT is the addition of a random number NA, that is

CST _(i) =CST _(i−1) +NA,

[0048] and

CPT _(i) =CP+i.NA.

[0049] At the end of these two transformations, the number i of iterations is stored with the transformed secret code CPT_(i) resulting from the previous application in the memory MNV, and the transformed presented code CPT_(i) is compared with the stored transformed secret code CST_(i).

[0050] As for the production of a random number at each presentation of the code CP, the determination of the transformed codes CPT_(i) and CST_(i) in a manner different from that of the transformed codes CPT_(i −1) and CST_(i−1) at the previous presentation ruins any deduction of the transformed code from the previous transformed code which depends on the number of presentations of the presented code. Thus, at each presentation, the stored transformed code is different from that stored at the previous presentation.

[0051] According to a fifth embodiment, each code is considered as divided into a number of parts, such as four digit octets for example. At the start of the method, the secret code CS is transformed by applying thereto a code transformation function FT so as to change the successive order of its octets, that is for example the transformed secret code CST resulting from the following predetermined permutation:

CST=FT[CS(OS1, OS2, OS3, OS4)]=(OS2, OS4, OS1, OS3).

[0052] At the time of the first presentation of the presented code CP, the same permutation is applied to the code CP by modifying the order of its octets OP1 to OP4:

CPT=FT[CP(OP1, OP2, OP3, OP4)](OP2, OP4, OP1, OP3).

[0053] During the first comparison at the step E7, the second octets OS2 and OP2 are compared, then the fourth octets OS4 and OP4 are compared, the first octets OS1 and OP1 are compared and finally the third octets OS3 and OP3 are compared. If one of the four octet comparisons is negative, access to the service of the card is denied.

[0054] At the time of a second verification of the presented code following a first use of the card, the transformation function FT again modifies the order of the transformed octets starting with the fourth octets OS4. Thus the transformed secret code at the time of this second presentation becomes the following:

CST=FT[CST(OS2, OS4, OS1, OS3)]=(OS4, OS3, OS2, OS1).

[0055] The presented code then undergoes two permutations in order to obtain the following transformed presented code:

CPT=FT[FT[CP(OP1, OP2, OP3, OP4)]]=(OP4, OP3, OP2, OP1).

[0056] Thus, at each presentation of the presented code CP, the permutation is applied to the transformed secret code CST resulting from the last presentation, and the permutation is also applied to the presented code CP, but a number of times equal to the number of previous permutations/presentations of the presented code. The corresponding parts of the permuted secret and presented codes CST, CPT are compared in pairs and the permuted secret code CST is stored in the card CA when the compared codes CST and CPT are identical.

[0057] The octets OS1 to OS4 of the secret code CS are thus never manipulated in the same order during two successive verifications of the presented code.

[0058] In order to increase security, the transformation function FT, to which there is applied the secret code CS at the step E2 or CST at the step E6 a, or else to which there is applied any other transformed secret code. CST_(i−1) at the step E6 b according to the previous embodiments, is homomorphic of the function FT, denoted hereinafter FT′, to which there is applied the presented code CP at the step E6 or at the step E6 a, or CPT_(i−1), at the step E6 b.

[0059] Each card supplier can choose their own transformation function FT homomorphic of a predetermined function FT′, or else a pair of functions [FT, FT′], which protects it against attacks.

[0060] According to a first example, the functions FT and FT′ are squarings of the sum of a confidential code and a random number NA. At the time the card is brought into service at the step E2 or E62, or at the time the secret code associated with the card is changed, the secret code CS undergoes the following transformation FT:

CST=FT(CS, NA)=CS ²+2 CS.NA+NA ²,

[0061] that is to say the transformed secret code CST results from the following successive calculations: calculation of CS squared, calculation of the double product 2 CS.NA, calculation of NA squared, and addition of the preceding three products.

[0062] The function FT′ applied to the presented code CP is also a squaring of the sum of this code with the random number NA. However, the calculation of the transformed presented code CPT follows a different process from the calculation of the secret code by the transformation FT. Thus the presented code CP is calculated according to the formula:

CPT=FT′(CP, NA)=(CP+NA)²,

[0063] starting by calculating the sum CP+NA, and then multiplying this sum by itself in order to obtain the presented code CPT.

[0064] Thus the process of calculating the presented code CPT at the step E6 is different from that for the secret code CST at the step E2 and therefore the wavelets corresponding to these two transformations are different.

[0065] According to a second example, the function FT applied to the secret code CS is such that CST=NB^(CS)×NB^(NA), that is applied by calculating the product of the number NB by itself CS times and the product of NB by itself NA times, and by multiplying the preceding two products. The transformed presented code CPT is calculated according to the formula CPT=FT′(CP, NA)=NB^(CP+NA), that is to say by calculating the product of NB by itself CP+NA times. NB designates any number whatsoever which is transmitted with the secret code CS and the random number NA to the card CA in order to be written therein in the memory MNV, at the step E3.

[0066] In the above description, it should be understood that smart card covers all known types of smart card, also referred to as microcontroller cards, such as cards with contacts or contactless cards stated below by way of a non-limitative example: credit cards (Visa cards), payment cards, telephone cards, SIM cards, “add-on” cards, purchasing centre cards, gaming cards, etc. More generally, the invention relates not only to smart cards but also other portable electronic objects designated equally well by electronic data processing means, such as electronic assistants or organisers, electronic purses, tokens, pocket calculators, etc.

[0067] The accepting terminal of the electronic data processing means can for example be of the type of a computer terminal, a personal computer, in particular a portable one, a bank terminal, a point-of-sale terminal, a radiotelephone terminal, a device for controlling access to premises or to a strong room, etc. The accepting means can be remote from the data processing means, these being connected by any data transmission means.

[0068] The confidential code in the sense of the invention is also designated in certain contexts as password, or secret code, or else PIN (Personal Identification Number) or CHV (Card Holder Verification) or PTI (Personal Telecommunication Identifier) in particular for radiotelephone terminal SIM cards.

[0069] The received confidential code is in general an alphanumeric code. It u can be applied to the data processing means, smart card or portable electronic object, by any known code entry means, other than a pushbutton keyboard, for example by voice and voice recognition, or else by recognition of a biometric signature, for example at least a fingerprint. 

1. A method for accessing a data processing means (CA) associated with a secret confidential code (CS) and accessible by applying thereto a confidential code presented (CP) by an accepting means (TE), characterised in that it comprises the following steps: first, implementation (E1) of a code transformation function (FT) in the processing means (CA), and then transformation (E2) of the secret code (CS) into a transformed secret code (CST) in the processing means according to the transformation function (FT) and storing (E3) of the transformed secret code (CST) in the processing means; and at each use of the processing means (CA), transformation (E6) of the presented code (CP) into a transformed presented code (CPT) according to the transformation function implemented in the processing means, and comparison (E7) of the transformed secret code with the transformed presented code in the processing means.
 2. A method in accordance with claim 1, according to which the transformation function is irreversible.
 3. A method in accordance with claim 1 or 2, according to which the transformation function is a hashing.
 4. A method in accordance with any one of claims 1 to 3, according to which each transformed code (CST, CPT) results from application of the respective confidential code (CS, CP) and a random number (NA) to the transformation function (FT), the random number (NA) being pre-stored with the transformed secret code (CST) in the processing means (CA).
 5. A method in accordance with claim 4, according to which two data processing means (CA) associated with identical secret confidential codes (CS) are associated with different random numbers (NA).
 6. A method in accordance with claim 4 or 5, according to which the random number (NA), is modified when the secret code (CS) associated with the processing means (CA) is modified.
 7. A method in accordance with any one of claims 1 to 3, according to which the previously stored transformed secret code (CST) results from application of the secret code (CS) and a first random number (NA) to the transformation function (FT), a second random number (NA′) is produced (E6 a) in the processing means (CA) before each transformation of the presented code, then a second transformed secret code (CST′) is determined by applying the stored transformed secret code (CST) and the second random number (NA′) to the transformation function, and the transformed presented code (CPT′) is determined by applying the presented code (CP) and the first random number (NA) to the transformation function in order to produce an intermediate transformed presented code (CPT) and applying the intermediate transformed presented code (CPT) and the second random number to the transformation function, the second transformed secret code (CST′) being compared with the transformed presented code (CPT′).
 8. A method in accordance with any one of claims 1 to 6, according to which, for each presentation of the presented code, the following steps are carried out: application (E6 b) of the transformation function (FT) to the previously stored transformed secret code (CST_(i−1)); applications (E6 b) of the transformation function (FT) to the presented code (CP) as many times as the number of previous presentations of the presented code; comparison (E7 b) of the transformed secret code (CST_(i)) and the transformed presented code (CPT_(i)) resulting from the previous applications; and storing of the transformed secret code (CST_(i)) in the processing means (CA).
 9. A method in accordance with claim 8, according to which the applications of the transformation function to the presented code (CP) are replaced by an application of a transformation function equivalent to the i^(th) iteration of the transformation function (FT) in order to produce a transformed presented code (CPT_(i)) to be compared (E7 b) with the transformed secret code (CST_(i)), and the number i of iterations is stored with the transformed secret code (CPT_(i)) resulting from the previous application in the processing means (CA).
 10. A method in accordance with any one of claims 1 to 3, according to which the transformation function (FT) consists of dividing each code (CS, CP) into a number of parts and of applying a predetermined permutation to the parts of the code, and according to which, at each presentation of the presented code (CP), the permutation is applied to the transformed secret code (CST) resulting from the last presentation, the permutation is applied to the presented code a number of times equal to the number of previous permutations of the presented code, the corresponding parts of the permuted secret and presented codes (CST, CPT) are compared in pairs, and the permuted secret code (CST) is stored in the processing means (CA).
 11. A method in accordance with any one of claims 1 to 10, according to which the transformation function (FT) to which there is applied the secret code (CS) is homomorphic of the transformation function (FT′) to which there is applied the presented code (CP). 